package com.nervenets.general.service;

import com.nervenets.general.jwt.util.JwtUtils;
import com.nervenets.general.model.SecurityUser;

import java.util.Set;

public interface GlobalSecurityService {
    default SecurityUser getUserInfo(String token, String license) {
        return JwtUtils.getUser(token, license);
    }

    default String getToken(SecurityUser securityUser, String license) {
        return JwtUtils.getToken(securityUser, license);
    }

    default void clearToken(long userId) {
        JwtUtils.clearToken(userId);
    }

    default void authorize(String token, String license, Set<String> menus, Set<String> permissions) {
        JwtUtils.authorize(token, license, menus, permissions);
    }

    default void logout(String token, String license) {
        JwtUtils.logout(token, license);
    }
}
